<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('配网工程精益化管控工具')"/>
    <link rel="stylesheet" th:href="@{/static/admin/css/load.css}"/>
    <link rel="stylesheet" th:href="@{/static/admin/css/admin.css}"/>
    <link rel="stylesheet" th:href="@{/static/admin/css/font/iconfont.css}"/>
    <!-- 主 题 更 换 -->
    <style id="pearadmin-bg-color"></style>
</head>
<!-- 结 构 代 码 -->
<body class="layui-layout-body pear-admin">
<!-- 布 局 框 架 -->
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <!-- 顶 部 左 侧 功 能 -->
        <ul class="layui-nav layui-layout-left">
            <li class="collaspe layui-nav-item"><a class="layui-icon layui-icon-shrink-right" href="#"></a></li>
            <li class="refresh layui-nav-item"><a class="layui-icon layui-icon-refresh-1" href="#" loading=600
                                                  title="刷新页面"></a></li>
        </ul>
        <!-- 顶 部 右 侧 菜 单 -->
        <div class="layui-layout-control" id="control"></div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide-xs"><a class="fullScreen layui-icon layui-icon-screen-full"
                                                        href="#"></a></li>
            <li class="layui-nav-item layui-hide-xs">
                <!--<a th:href="@{/SysNoticeController/viewUser}" class="layui-icon layui-icon-notice">
                    <span class="layui-badge" th:text="${session.notices.size()}"></span>
                </a>-->
                <!--                <a  id="menu-msg" class="layui-icon layui-icon-notice" menu-type="1" th:menu-url="@{/SysNoticeController/viewUser}" menu-id="n4" href="javascript:;">-->
                <!--                    <span class="layui-badge" th:text="${session.notices.size()}"></span>-->
                <!--                </a>-->

            </li>
<!--            <li class="layui-nav-item layui-hide-xs">-->
<!--                <a href="/enter">-->
<!--                    <img class="layui-nav-img" th:src="@{/static/admin/images/img/kanban.png}">-->
<!--                    <span>评价看板</span>-->
<!--                </a>-->
<!--            </li>-->
            <li class="layui-nav-item">
                <!-- 头 像 -->
                <a href="javascript:;">
                    <img class="layui-nav-img" id="headImg" src="">
                    <span th:text="${session.sessionUserName}"></span>
                </a>
                <!-- 功 能 菜 单 -->
                <dl class="layui-nav-child">
                    <dd><a onclick="editPwd()">修改密码</a></dd>
                    <dd><a class="logout" href="javascript:void(0);">注销登录</a></dd>
                </dl>
            </li>
            <!--                        <li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>-->
        </ul>
    </div>
    <!-- 侧 边 区 域 -->
    <div class="layui-side layui-bg-black">
        <!-- 顶 部 图 标 -->
        <div class="layui-logo">
            <img class="logo"></img>
            <span class="title"></span>
        </div>
        <!-- 侧 边 菜 单 -->
        <div class="layui-side-scroll">
            <div id="sideMenu"></div>
        </div>
    </div>
    <div class="layui-body">
        <div id="content"></div>
    </div>
</div>
<!-- 遮 盖 层 -->
<div class="pear-cover"></div>
<!-- 加 载 动 画-->
<div class="loader-main">
    <div class="loader"></div>
</div>
<!-- 依 赖 脚 本 -->
<th:block th:include="include :: footer"/>
<script th:src="@{/static/admin/js/headImg.js}"></script>
<script th:inline="javascript">
    layui.use(['admin', 'jquery', 'layer', 'popup'], function () {
        var admin = layui.admin;
        var $ = layui.jquery;
        var layer = layui.layer;
        var popup = layui.popup;
        admin.render();

        $('#headImg').attr("src", makeHeadImgByUserName([[${session.sessionUserName}]]));

        $("#menu-msg").click(function () {
            layui.tab.addTabOnlyByElem("content", {
                id: $(this).attr("menu-id"),
                title: "公告展示",
                url: $(this).attr("menu-url"),
                close: "允许关闭"
            })
        })

        // 注销实现
        admin.logout(function () {
            var loading = layer.load();
            $.ajax({
                url: rootPath + '/admin/Loginout',
                dataType: 'json',
                type: 'get',
                success: function (result) {
                    if (result.code == 200) {
                        popup.success(result.msg, function () {
                            location.href = rootPath + "/";
                        });
                        return true;
                    }
                }
            })
            return true;
        })
    })

    // var MODULE_PATH = ;
    function editPwd() {
        layer.open({
            type: 2,
            title: '修改密码',
            shade: 0.1,
            area: ['500px', '500px'],
            content: rootPath + "/UserController/editPwd2"
        });
    }
</script>
</body>
</html>
